Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update swf.executor #30: handle more then 1,000 open activity tasks #31

Merged
merged 1 commit into from
Mar 16, 2015

Conversation

ggreg
Copy link
Contributor

@ggreg ggreg commented Mar 10, 2015

Fix #30.

Ready for review! 📒

These changes introduce a private counter swf.executor._open_activity_count that counts the number of activity task that are scheduled or staged to be scheduled in the next decisions. The counter is incremented when a event is translated to a future or when there is no event and the executor needs to schedule one.

@ggreg ggreg force-pushed the fix/handling-of-more-than-1000-activities branch from f3d684a to b4cc0ba Compare March 11, 2015 15:36
@ggreg
Copy link
Contributor Author

ggreg commented Mar 16, 2015

pypy build is failing on:

=================================== FAILURES ===================================
______________________ test_workflow_with_child_workflow _______________________
    def test_workflow_with_child_workflow():
        workflow = TestDefinitionChildWorkflow
        executor = Executor(DOMAIN, workflow)

        history = builder.History(workflow,
                                  input={'args': (1,)})

        # The executor should schedule the execution of a child workflow.
        decisions, _ = executor.replay(history)
        assert len(decisions) == 1
        assert decisions == [{
            'startChildWorkflowExecutionDecisionAttributes': {
                'workflowId': 'workflow-test_workflow-1',
                'taskList': {
                    'name': 'test_task_list'
                },
                'executionStartToCloseTimeout': '3600',
                'input': '{"args": [1], "kwargs": {}}',
                'workflowType': {
                    'version': 'test_version',
                    'name': 'test_workflow'
                },
                'taskStartToCloseTimeout': '300'
            },
            'decisionType': 'StartChildWorkflowExecution'
        }]

        # Let's add the child workflow to the history to simulate its completion.
        (history
            .add_decision_task()
            .add_child_workflow(
                workflow,
                workflow_id='workflow-test_workflow-1',
                task_list=TestWorkflow.task_list,
                input='"{\\"args\\": [1], \\"kwargs\\": {}}"',
                result='4'))

        # Now the child workflow is finished and the executor should complete the
        # workflow.
        decisions, _ = executor.replay(history)
        workflow_completed = swf.models.decision.WorkflowExecutionDecision()
        workflow_completed.complete(result=json.dumps(4))

>       assert decisions[0] == workflow_completed
E       assert {'decisionTyp...st_version'}}} == {'decisionType...result': '4'}}
E         Detailed information truncated, use "-vv" to show
tests/test_dataflow.py:643: AssertionError
=============== 1 failed, 31 passed, 15 warnings in 3.87 seconds ===============
The command "py.test" exited with 1.
Done. Your build exited with 1.

@ggreg
Copy link
Contributor Author

ggreg commented Mar 16, 2015

Merging and fixing pypy build in another issue.

@ggreg ggreg force-pushed the fix/handling-of-more-than-1000-activities branch from b4cc0ba to 01f6968 Compare March 16, 2015 13:45
ggreg added a commit that referenced this pull request Mar 16, 2015
…0-activities

Update swf.executor #30: handle more then 1,000 open activity tasks
@ggreg ggreg merged commit 8ee1b1b into master Mar 16, 2015
@ggreg ggreg deleted the fix/handling-of-more-than-1000-activities branch March 16, 2015 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

SWF: handle limit of 1,000 open activity tasks
1 participant